<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>散点图</title>
    <script src="../../echarts.min.js"></script>
</head>
<body>
    <div id="main" style="height: 400px;width: 600px;"></div>
</body>
<script>
    let mychart = echarts.init(document.getElementById("main"))
    let option = {
        title:{
            text:"散点图"
        },
        legend:{
            data:["数据一","数据二"]
        },
        xAxis:{},
        yAxis:{},
        tooltip:{
            trigger:"item",
            formatter:"{a}--({c})"
        },
        series:[{
            name:"数据一",
            data:[
                [2.0,8.04],
                [3.0,6.95],
                [23.0,7.58],
                [18.0,8.81],
                [12.0,8.33],
                [4.0,9.96],
                [16.0,7.24],
                [14.0,4.26],
                [12.0,10.84],
                [10.0,4.82],
                [7.0,5.68]
            ],
            type:'scatter'
        },
        {
            name:'数据二',
            data:[
                [1.0,2.04],
                [2.0,15.95],
                [26.0,17.58],
                [13.0,7.81],
                [22.0,5.33],
                [14.0,9.96],
                [6.0,4.24],
                [4.0,4.26],
                [22.0,13.84],
                [16.0,14.82],
                [17.0,15.68]
            ],
            type:"scatter"
        }
        ],
        
    }
    mychart.setOption(option)
</script>
</html>